package top.yxqz.spring.ts.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import top.yxqz.spring.ts.service.BookService;

/**
 * @author: 余小小
 * @date: 2023/4/18
 * @description： 图书控制层
 */
@Controller
public class BookController {

    @Autowired
    @Qualifier("bookService")
    private BookService bookService;


    @Autowired
    @Qualifier("bookServicexml")
    private BookService bookService2;

    /**
     * 购买图书
     *
     * @param userId
     * @param bookId
     */
    public void buyBook(Integer userId, Integer bookId) {
        bookService.buyBook(userId, bookId);
    }

    public void buyBookXML(Integer userId, Integer bookId) {
        bookService2.buyBook(userId, bookId);
    }
}
